package com.marquisx.tzdice;

public class Constants
{
	public static final boolean LOGGING = true;
	
	public static final int ALPHA_SELECTED = 255;
	public static final int ALPHA_SEMITRANSPARENT = 150;
	public static final int ALPHA_UNSELECTED = 100;
	public static final int ALPHA_DICE_BG = 70;
	public static final int ALPHA_BG_PIC = 100;
	public static final int DEFAULT_OFFSET = 0;
	public static final int DEFAULT_TIMES = 1;

	public static final int SPLASH_SHOW_TIME = 1500;
	public static final int SPLASH_SHOW_TIME_KOREA = 3000;

	public static final String PREF = "TZDice_Pref";
	public static final String SELECTED_ACTION_ID = "Selected_Action_ID";
	public static final String SELECTED_PIC_ID = "Selectd_Pic_ID";
	public static final long NEW_ACTION_ID = 0;
	public static final int DEF_PIC_ID = R.drawable.action_pic_000;
	public static final String USER_PROFILE_PIC_ID = "User_Profile_Pic_ID";
	public static final int USE_RPROFILE_PIC_ID_DEF = R.drawable.user_profile_000;
	public static final int OPT_DICE_DEF = 6; // R.integer.app_default_dice;
	public static final int OPT_TIMES_MAX_DEF = 10; // R.integer.app_default_times;
	public static final int OPT_OFFSET_MAX_DEF = 15; // R.integer.app_default_offset_max;
	public static final int OPT_OFFSET_MIN_DEF = -15; // R.integer.app_default_offset_min;
	public static final int OPT_TEXT_SIZE_DEF = 16;
	
	public static final int OPT_BG_COLOR_DEF = 0x3500FFFF; //R.color.background;
	public static final int OPT_BG_PIC_DEF = R.drawable.background_pic_01;
	
	/** The maximum of dice record in the list view */
	public static final int RECORD_ITEM_MAXIMUM = 20;
	
	public static final int OPT_TIMES_UPPER_LIMIT = 100;
	public static final int OPT_TIMES_LOWER_LIMIT = 1;
	
	public static final int OPT_OFFSET_MAX_UPPER_LIMIT = 100;
	public static final int OPT_OFFSET_MAX_LOWER_LIMIT = -100;
	
	public static final int OPT_OFFSET_MIN_UPPER_LIMIT = 100;
	public static final int OPT_OFFSET_MIN_LOWER_LIMIT = -100;
	

	public enum RecordType
	{
		Speak(R.string.record_type_say), Roll(R.string.record_type_roll),
		Whisper(R.string.record_type_whisper),Roll_Secret(R.string.record_type_roll_secret);
		
		private int stringId;

		private RecordType(int stringId)
		{
			this.stringId = stringId;
		}

		public int getStringId()
		{
			return stringId;
		}
	}
	
	public enum DiceType
	{
		NO_DICE("", -1, -1), D4("D4", 4, R.drawable.d4), D6("D6", 6, R.drawable.d6), 
		D8("D8", 8,R.drawable.d8), D10("D10", 10, R.drawable.d10), D12("D12", 12, R.drawable.d12), 
		D20("D20", 20, R.drawable.d20),	D100("D100", 100, R.drawable.d100);
		
		public static DiceType getDiceType(int diceNumber)
		{
			switch(diceNumber)
			{
				case -1:
					return NO_DICE;
				case 4:
					return D4;
				case 6:
					return D6;
				case 8:
					return D8;
				case 10:
					return D10;
				case 12:
					return D12;
				case 20:
					return D20;
				case 100:
					return D100;
				default:
					return NO_DICE;
			}
		}
		
		private int diceNumber;
		private int dicePicId;
		private String diceName;
		
		private DiceType(String diceName, int diceNumber, int dicePicId)
		{
			this.diceName = diceName;
			this.diceNumber = diceNumber;
			this.dicePicId = dicePicId;
		}
		
		public String getDiceName()
		{
			return diceName;
		}
		public int getDiceNumber()
		{
			return diceNumber;
		}
		public int getDicePicId()
		{
			return dicePicId;
		}
	}
}
